<template>
	<view v-show="show && loaded">
		
		<view class="fixed z10 coverBg" :style="{'background-image':`url(${img})`}">
			<slot></slot>
		</view>
		
	</view>
</template>

<script>
	export default {
		name: 'welcome',
		data() {
			return {
				img : '' ,
				loaded : false 
			};
		},
		created() {
			this.img = this.kit.myHost + "/images/bg.jpg" ;
			uni.getImageInfo({
				src:this.kit.myHost + "/images/bg.jpg" ,
				success: (res) => {
					this.loaded = true ;
				},
				fail: (res) => {
					console.log(res);
				}
			});
		},
		props: {
			show:{
				default : false 
			}
		}
	}
</script>

<style lang="scss">
.coverBg{
	background-color: #fff;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
}
</style>
